﻿using DataConvertLib;
using System;
using System.Globalization;
using System.Windows.Data;

namespace PLCWpfTest.Converters
{
    public class ByteToDataTypeStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                throw new ArgumentNullException("Value can not be null");
            }
            string dataType =  ((DataType)(byte)value).ToString();
            return dataType;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
